package com.myx.service.news;

import com.myx.dao.news.NewsDao;
import com.myx.dao.news.NewsDaoImpl;
import com.myx.pojo.News;

import java.util.List;

public class NewsServiceImpl implements NewsService{
    private NewsDao newsDao=new NewsDaoImpl();
    @Override
    public List<News> getNewsListPages(Integer currentNo, Integer pageSize) {

        return this.newsDao.getNewsListPages(currentNo,pageSize);
    }

    @Override
    public News getNewsById(int newsId) {
        return this.newsDao.getNewsById(newsId);
    }

    @Override
    public List<News> getNewsListPagesByCategoryId(Integer categoryId, Integer currentNo, Integer pageSize) {
        return this.newsDao.getNewsListPagesByCategoryId(categoryId,currentNo,pageSize);
    }

    @Override
    public boolean addNews(News news) {

        return this.newsDao.addNews(news);
    }

    @Override
    public boolean modifyNews(News news) {
        return this.newsDao.modifyNews(news);
    }

    @Override
    public boolean deleteNews(Integer newsId) {
        return this.newsDao.deleteNews(newsId);
    }

    @Override
    public List<News> getNewsListPagesByTitle(String title, Integer pageNo, Integer pageSize) {

        return this.newsDao.getNewsListPagesByTitle(title,pageNo,pageSize);
    }


}
